﻿using System;

namespace abc
{
    class Program
    {
        public static void Main(String []args)
        {
            int num = 0;
            Console.WriteLine("请输入数据的上限");
            int max;
            max = int.Parse(Console.ReadLine());
            Console.WriteLine("请输入数据的下限");
            int min;
            min = int.Parse(Console.ReadLine());
            if((min<=1 || max <= 1) || min > max)
            {
                Console.WriteLine("您输入的数据不合法");
            }
            else
            {
                
                for (int i = min; i <= max; i++)
                {
                    
                    bool flag = true;
                    for (int j = 2; j <= Math.Sqrt(i); j++)
                    {
                        if (i % j == 0)
                        {
                            flag = false;
                        }
                    }
                    if (flag)
                    {
                        Console.Write(i+" ");
                        num++;
                    }
                    if (num % 10 == 0)
                    {
                        Console.WriteLine();
                    }
                }
            }
        }
    }
}